<!--
 * @Author: your name
 * @Date: 2020-05-20 14:59:51
 * @LastEditTime: 2020-06-29 11:11:25
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \IM_Web\im_web\src\App.vue
--> 
<template>
    <div id="app">
        <!-- <img alt="Vue logo" src="./assets/logo.png">
    <Button type="primary">Primary</Button>
    <Tabs value="name1">
        <TabPane label="标签一" name="name1">标签一的内容</TabPane>
        <TabPane label="标签二" name="name2">标签二的内容</TabPane>
        <TabPane label="标签三" name="name3">标签三的内容</TabPane>
    </Tabs>
        <HelloWorld msg="Welcome to Your Vue.js App"/>-->
        <router-view v-if="isRouterAlive"></router-view>
    </div>
</template>

<script>
// import HelloWorld from './components/HelloWorld.vue'
export default {
    name: "App",
    provide() {
        //父组件中通过provide来提供变量，在子组件中通过inject来注入变量。
        return {
            reload: this.reload
        };
    },
    data() {
        return {
            isRouterAlive: true
        };
    },
    created() {
        // if (
        //     JSON.parse(sessionStorage.getItem("info")) !== "" &&
        //     JSON.parse(sessionStorage.getItem("info")) !== ""
        // ) {
        //     let info = JSON.parse(sessionStorage.getItem("info"));
        //     this.init(info.token, info.accid);
        // }
        sessionStorage.setItem("loading", true);
    },
    updated() {
        // 提交sdk连接请求
        console.log("updatedPage");
        this.$store.dispatch("connect");
        this.$store.dispatch("updateRefreshState");
    },
    methods: {
        reload() {
            console.log(1111)
            this.isRouterAlive = false; //先关闭，
            this.$nextTick(function() {
                this.isRouterAlive = true; //再打开
            });
        }
    },
    components: {
        // HelloWorld
    }
};
</script>

<style>
#app {
    min-height: 100vh;
    min-width: 1280px;
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    /* margin-top: 60px; */
}
.emoji-small {
    width: 32px;
    height: 32px;
}
</style>
